From : MO Tiffany (cca93057@sun1.bham.ac.uk)
Subject : System Calls
Listen.  And I will tell you a story.  Are you sitting comfortably?

All System calls (those with an underscore after them) require pointers to the 
appropriate intuition structure, be it a window, a bitmap or a font.

All Blitz calls use handy things called object numbers.  THESE ARE NOT THE SAME!
To get the address of the BLITZ object in memory, you use the command

ad.l=Addr Window (0)  ; or whatever it is you are looking at.

This does _NOT_ point to the intuition structure (well, mostly).
What it does point to is the _BLITZ_ object structure.
Now, go get your Blitz manual, you know, that thing everyone moans about and 
never seems to use...and go to the section labelled BLITZ OBJECTS.

Looky here - what do we have, the full Blitz Object structures.  Well, guess
what, they are also in a resident file for you too (blitzobj.res is it?).
Well, either type in the required newtype, or put the .res into the compiler
options, and presto, we can access the Blitz object.

Now.  Lets look at the Blitz object.  What does it say in the .window bit, ah
yes, the first long word is _A POINTER TO THE INTUITION WINDOW STRUCTURE_.
This is what we need.  Two ways to get it, the dirty and the fancy method.  =)

DIRTY METHOD
============

ad.l=addr window(0)
win_addr.l=peek.l(ad.l)   ; grabs the first long word from the blitz structure
                          ; so that win_addr is the memory address of the
                          ; intuition object.

You could just muddle this up onto one line of course.

FANCY METHOD
============

*blitz_win.window=addr window(0)
*intui_win.Window=*blitz_win\_win    ; or whatever the blitz object offset is

*intui_win is now the address of the intuition structure, but we can also
start playing with stuff (like the rather handy MinWidth,MinHeight tags
that restrict the sizing limits of your window).

So now you can pass the correct address to the system call.
Also note that you should always use null terminated strings, and it is
invariably the address of the string that you send, ie &text$,or most usefully,
Null(t$).

Another thing to watch is that most blitz objects are separate to their
System counterparts, and have pointers to them embedded inside them.
There  are exceptions though just to confuse you, such as Bitmaps, where the
so called Blitz object is actually the System one.  This means that the address 
of the Intuition structure is at    Addr Bitmap(0).